<?php

function GetDomain($url)   
{
$nowww = ereg_replace('www.','',$url);
$domain = parse_url($nowww);
if(!empty($domain["host"]))
    {
        return $domain["host"];
    }
else
    {
        return $domain["path"];
    }
}

?>
